<?php
/**
 * Created by PhpStorm.
 * User: august
 * Date: 2021/2/23
 * Time: 16:48
 */

namespace app\validate;


use think\Validate;

class AdminUserValidate extends Validate
{
    protected $rule = [
        'username' => 'require|max:32',
        'email' => 'email',
        'mobile' => 'mobile',
        'password' => 'require|max:16',
        'password2' => 'require|confirm:password'
    ];

    protected $message = [
        'username.require' => '名称必须',
        'username.max' => '名称不能超过32个字符',
        'email' => '邮箱格式不正确',
        'mobile' => '手机格式不正确',
        'password.require' => '密码必须',
        'password.max' => '密码不能超过16位',
        'password2.require' => '确认密码必须',
        'password2.confirm' => '确认密码与密码不一致',
    ];

    protected $scene = [
        'login' => ['username', 'password'],
        'register' => ['username', 'password', 'password2', 'email', 'mobile'],
    ];


}